package com.springboot.rabbitmq.queue;

import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @author: zyj
 * @create: 2020-11-10 11:43
 **/
public enum  QueueEnum {

    DX_SYN_SIGN("test-mangager",  "test-mangager", "testsign","testsign","测试rabbitmq");


    public final static String DX_SYN_SIGN_QUEUE = "custSynSignDx";


    private String modelExchange;//模块名称(交换机名称)
    private String modelExchangeName;//模块名称(交换机名称)
    private String routingKey;
    private String queueName;
    private String descrip;

    QueueEnum(String modelExchange, String modelExchangeName, String routingKey, String queueName, String descrip){
        this.modelExchange = modelExchange;
        this.modelExchangeName = modelExchangeName;
        this.routingKey = routingKey;
        this.queueName = queueName;
        this.descrip = descrip;
    }



    public static List<String[]> getQueueByModelExchange(String modelExchange){
        List<String[]> queues = new ArrayList<>();
        for(QueueEnum queueEnum : QueueEnum.values()){
            String modelExchangeStr = queueEnum.getModelExchange();
            String modelExchangeNameStr = queueEnum.getModelExchangeName();
            String routingKeyStr = queueEnum.getRoutingKey();
            String queueNameStr = queueEnum.getQueueName();
            String descripStr = queueEnum.getDescrip();
            if(modelExchangeStr.equals(modelExchange)){
                String[] queueStrs = new String[]{modelExchangeNameStr, routingKeyStr, queueNameStr, descripStr};
                queues.add(queueStrs);
            }
        }
        return queues;
    }

    public String getModelExchange() {
        return modelExchangeName;
    }

    public void setModelExchange(String modelExchange) {
        this.modelExchange = modelExchange;
    }


    public String getModelExchangeName() {
        return modelExchangeName;
    }

    public void setModelExchangeName(String modelExchangeName) {
        this.modelExchangeName = modelExchangeName;
    }

    public String getRoutingKey() {
        return routingKey;
    }

    public void setRoutingKey(String routingKey) {
        this.routingKey = routingKey;
    }

    public String getQueueName() {
        return queueName;
    }

    public void setQueueName(String queueName) {
        this.queueName = queueName;
    }

    public String getDescrip() {
        return descrip;
    }

    public void setDescrip(String descrip) {
        this.descrip = descrip;
    }
}
